﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// 控制角色UI
/// </summary>
public class CharacterUI : MonoBehaviour {

    public Image img_Head;
    public Image img_Identity;
    public Text txt_Name;
    public Text txt_Remain;
    public Text txt_Integral;


    /// <summary>
    /// 设置身份
    /// </summary>
    /// <param name="identity"></param>
    public void SetIdentity(Identity identity)
    {
        Sprite Head = null;
        Sprite iden = null;
        switch (identity)
        {
            case Identity.Farmer:
                Head = Resources.Load<Sprite>("Pokers/Role_Farmer");
                iden = Resources.Load<Sprite>("Pokers/Identity_Farmer");
                break;
            case Identity.Landlord:
                Head = Resources.Load<Sprite>("Pokers/Role_Landlord");
                iden = Resources.Load<Sprite>("Pokers/Identity_Landlord");
                break;
            default:
                break;
        }
        if (Head == null || iden == null)
        {
            Debug.LogError("设置身份的图片不存在！");
            return;
        }
        img_Head.sprite = Head;
        img_Identity.sprite = iden;
    }
    /// <summary>
    /// 设置积分
    /// </summary>
    /// <param name="integration"></param>
    public void SetIntegration(int integration)
    {
        txt_Integral.text = integration.ToString();
    }
    /// <summary>
    /// 设置剩余手牌
    /// </summary>
    /// <param name="Remain"></param>
    public void SetRemain(int Remain)
    {
        txt_Remain.text = Remain.ToString();
    }
}
